package com.example.demo.day0304;

public class DemoRunnable implements Runnable {//实现接口可避免单继承的局限性
    int count = 0;
    public void run() {//实现run方法，
        System.out.println(Thread.currentThread().getName() + "Runnable多线程运行的代码");//Thread.currentThread().getName获取线程的名称
        for (int i = 0;i < 5;i++){
            count++;
            System.out.println("这是Runnable多线程运行的代码" + count);
        }
    }
}
